//1、引入 axios 
import axios from "axios"
//2、创建axios实例
const request = axios.create({
    timeout: 5000,
    baseURL: process.env['VUE_APP_BASE_URL']
})
//3、创建请求拦截
request.interceptors.request.use(function (config) {
    return config;
  }, function (error) {
    return Promise.reject(error);
  });
//4、创建响应拦截
request.interceptors.response.use(function (response) {
    return response.data.data;
  }, function (error) {
    return Promise.reject(error);
  });

//5、导出axios实例对象
export default request
